# Copyright 2019 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Tests for common transforms.

load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")
load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite")

package(
    features = ["layering_check"],
    licenses = ["notice"],  # Apache 2.0
)

iree_lit_test_suite(
    name = "lit",
    srcs = enforce_glob(
        [
            "annotate_winograd_loops.mlir",
            "break_down_large_vector.mlir",
            "config_adreno_conv.mlir",
            "config_adreno_matmul.mlir",
            "config_amd_conv.mlir",
            "config_amd_matmul.mlir",
            "config_amd_matmul_cooperative_ops.mlir",
            "config_amd_matvec.mlir",
            "config_default_conv.mlir",
            "config_default_linalg_ext_ops.mlir",
            "config_default_linalg_ops.mlir",
            "config_default_matmul.mlir",
            "config_default_misc.mlir",
            "config_default_reduction.mlir",
            "config_default_sub_byte_types.mlir",
            "config_mali_conv.mlir",
            "config_mali_matmul.mlir",
            "config_nvidia_matmul.mlir",
            "config_nvidia_matmul_cooperative_ops.mlir",
            "config_user.mlir",
            "convert_to_spirv.mlir",
            "convert_gpu_target.mlir",
            "emulate_i64.mlir",
            "erase_storage_buffer_static_shape.mlir",
            "illegal_configuration.mlir",
            "link_executables.mlir",
            "lower_masks.mlir",
            "lowering_matmul_fusion.mlir",
            "lowering_matmul_promotion.mlir",
            "lowering_matvec.mlir",
            "lowering_scalar_dispatch.mlir",
            "lowering_reduction.mlir",
            "map_memref_storage_class.mlir",
            "materialize_executable_conditions.mlir",
            "pipeline_matmul_cooperative_ops.mlir",
            "pipeline_matmul_promotion.mlir",
            "pipeline_matmul_vectorization.mlir",
            "pipeline_matvec.mlir",
            "pipeline_reduction_subgroup.mlir",
            "pipeline_sub_byte_dequant.mlir",
            "physical_storage_buffer_addresses.mlir",
            "tile_and_distribute.mlir",
            "tile_and_distribute_scatter.mlir",
            "tile_and_distribute_sort.mlir",
            "tile_and_promote_cooperative_matrix.mlir",
            "tile_and_promote_matmul.mlir",
            "tile_and_vectorize_batch_matmul.mlir",
            "tile_and_vectorize_conv.mlir",
            "tile_and_vectorize_matmul.mlir",
            "tile_and_vectorize_pooling.mlir",
            "tile_and_vectorize_to_cooperative_ops.mlir",
            "trim_executable_target_env.mlir",
            "vectorize_conv.mlir",
            "vectorize_elementwise_ops.mlir",
            "vectorize_gather.mlir",
            "vectorize_matmul.mlir",
            "vectorize_load_store.mlir",
            "vectorize_reduction.mlir",
        ],
        include = ["*.mlir"],
        exclude = [
            "transform_dialect_dummy_spec.mlir",
        ],
    ),
    cfg = "//compiler:lit.cfg.py",
    tools = [
        "//tools:iree-opt",
        "@llvm-project//llvm:FileCheck",
    ],
)
